<template>
	<div class="content">
		<div class="clear" style="padding-bottom:20px;">
			<Form :model="query" label-position="left" :label-width="100">
				<Input v-model="query.number" class="w200 m-r10" placeholder="项目编号" />
				<Select placeholder="请选状态" class="w200 m-r10" v-model="query.status">
					<Option value="0">请选择状态</Option>
					<Option value="1">进行中</Option>
					<Option value="2">已结算</Option>
				</Select>
				<DatePicker :value="dataValue" type="daterange" split-panels placeholder="请选择时间段" class="w200 m-r10" format="yyyy-MM-dd" @on-change="getTime"></DatePicker>
				<Button type="primary" v-on:click="getConditionQuery()">查询</Button>
				<Button type="primary" class="fr" @click="add">发布</Button>
			</Form>
		</div>
		<Table stripe :columns="columns1" :data="data1"></Table>
		<Page :total="info" show-elevator :page-size="pageSize" show-total @on-change="cuctGetQuery" :current.sync="page"></Page>
		<!-- 发布弹出层 -->
		<Modal v-model="Modal" title="发布" width="40%">
			<Form :label-width="140" :model="addForm" :rules="rules" ref="refuse">
				<FormItem label="项目标题(中文)" prop="cnTitle">
					<Input class="w-50" v-model="addForm.cnTitle" placeholder="请输入项目标题(中文)" />
				</FormItem>
				<FormItem label="项目标题(英文)" prop="usTitle">
					<Input class="w-50" v-model="addForm.usTitle" placeholder="请输入项目标题(英文)" />
				</FormItem>
				<!-- <FormItem label="项目标题(越南语)" prop="vnTitle">
          <Input class="w-50" v-model="addForm.vnTitle" placeholder="请输入项目标题(越南语)" />
        </FormItem>-->
				<FormItem label="项目描述(中文)" prop="cnDetails">
					<quill-editor v-model="addForm.cnDetails" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="项目描述(英文)" prop="usDetails	">
					<quill-editor v-model="addForm.usDetails	" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<!-- <FormItem label="项目描述(越南语)" prop="vnDetails">
          <quill-editor
            v-model="addForm.vnDetails"
            ref="myQuillEditor"
            :options="editorOption"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
        </FormItem>-->
				<!-- <FormItem label="参与说明" prop="joinExplain">
          <quill-editor
            v-model="addForm.joinExplain "
            ref="myQuillEditor"
            :options="editorOption9"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
         
        </FormItem>
         <FormItem label="收益规则说明" prop="ruleExplain">
          <quill-editor
            v-model="addForm.ruleExplain "
            ref="myQuillEditor"
            :options="editorOption10"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
        </FormItem>-->
				<FormItem label="项目价值" prop="price">
					<Input class="w-50" v-model="addForm.price" placeholder="请输入项目价值" />
				</FormItem>
				<!-- <FormItem label="产品详情" prop='details'>
					<Input class="w-50" v-model="addForm.details" placeholder="请输入产品详情" type="textarea" />
        </FormItem>-->
				<FormItem label="每份usdt" prop="freight">
					<Input class="w-50" v-model="addForm.pay" placeholder="请输入每份usdt" />
				</FormItem>
				<FormItem label="目标份额" prop="freight">
					<Input class="w-50" v-model="addForm.total" placeholder="请输入目标份额" />
				</FormItem>
				<FormItem label="预估收益(usdt)" prop="freight">
					<Input class="w-50" v-model="addForm.earnings" placeholder="请输入预估收益(usdt)" />
				</FormItem>
				<FormItem label="参与开始时间">
					<DatePicker type="datetime" placeholder="请选择时间" v-model="addForm.time" @on-change="joinTime1"></DatePicker>
				</FormItem>
				<FormItem label="产品主图" prop="picture">
					<Input class="w-50" v-model="addForm.picture" placeholder="#" type="textarea" />
				</FormItem>
				<FormItem label="当前图片" v-if="imgUrl">
					<img :src="imgUrl" alt width="200" />
				</FormItem>
				<template>
					<Upload type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers="myHeaders" :on-success="handleSuccess" name="file" ref="upload1">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品主图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="产品详情图" prop="pictureDetails">
					<Input class="w-50" v-model="addForm.pictureDetails" placeholder="#" type="textarea" />
				</FormItem>
				<template>
					<Upload multiple type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers="myHeaders" :on-success="handleSuccess2" name="file" ref="upload2">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品详情图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="建议图片尺寸">宽：400px 高：400px</FormItem>
				<FormItem label="图片格式">jpg、gif、png</FormItem>
				<FormItem label="图片大小">不超过10mb 图片太大影响加载速度</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="productCannel">取消</Button>
				<Button type="primary" size="large" :loading="marked" @click="postAddMangement()">确定</Button>
			</div>
		</Modal>
		<!-- 修改 -->
		<Modal v-model="Modal1" title="修改" width="40%">
			<Form :label-width="140" :model="updateForm" ref="refuse">
				<FormItem label="项目标题(中文)" prop="cnTitle">
					<Input class="w-50" v-model="updateForm.cnTitle" placeholder="请输入项目标题(中文)" disabled />
				</FormItem>
				<FormItem label="项目标题(英文)" prop="usTitle">
					<Input class="w-50" v-model="updateForm.usTitle" placeholder="请输入项目标题(英文)" disabled />
				</FormItem>
				<!-- <FormItem label="项目标题(越南语)" prop="vnTitle">
          <Input class="w-50" v-model="updateForm.vnTitle" placeholder="请输入项目标题(越南语)" disabled />
        </FormItem>-->
				<FormItem label="项目描述(中文)" prop="cnDetails">
					<quill-editor v-model="updateForm.cnDetails" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="项目描述(英文)" prop="usDetails">
					<quill-editor v-model="updateForm.usDetails" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<!-- <FormItem label="项目描述(越南语)" prop="vnDetails">
          <quill-editor
            v-model="updateForm.vnDetails"
            ref="myQuillEditor"
            :options="editorOption"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
        </FormItem>-->
				<!-- <FormItem label="参与说明" prop="joinExplain ">
          <quill-editor
            v-model="updateForm.joinExplain "
            ref="myQuillEditor"
            :options="editorOption7"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
         
        </FormItem>
         <FormItem label="收益规则说明" prop="ruleExplain ">
          <quill-editor
            v-model="updateForm.ruleExplain "
            ref="myQuillEditor"
            :options="editorOption8"
            @blur="onEditorBlur($event)"
            @focus="onEditorFocus($event)"
            @change="onEditorChange($event)"
          ></quill-editor>
        </FormItem>-->
				<FormItem label="项目价值" prop="price">
					<Input class="w-50" v-model="updateForm.price" placeholder="请输入项目价值" />
				</FormItem>
				<!-- <FormItem label="产品详情" prop='details'>
					<Input class="w-50" v-model="addForm.details" placeholder="请输入产品详情" type="textarea" />
        </FormItem>-->
				<FormItem label="每份usdt" prop="pay">
					<Input class="w-50" disabled v-model="updateForm.pay" placeholder="每日exuu价值" />
				</FormItem>
				<FormItem label="目标份额" prop="total">
					<Input class="w-50" disabled v-model="updateForm.total" placeholder="请输入目标份额" />
				</FormItem>
				<FormItem label="预估收益" prop="earnings">
					<Input class="w-50" v-model="updateForm.earnings" placeholder="请输入预估收益" />
				</FormItem>
				<FormItem label="参与开始时间">
					<DatePicker type="datetime" placeholder="请选择时间" v-model="updateForm.joinTime" @on-change="joinTime1" disabled></DatePicker>
				</FormItem>
				<FormItem label="产品主图" prop="picture">
					<Input class="w-50" v-model="updateForm.picture" placeholder="#" type="textarea" />
				</FormItem>
				<FormItem label="当前图片" v-if="imgUrl">
					<img :src="imgUrl" alt width="200" />
				</FormItem>
				<template>
					<Upload type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers="myHeaders" :on-success="handleSuccess" name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品主图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="产品详情图" prop="pictureDetails">
					<Input class="w-50" v-model="updateForm.pictureDetails" placeholder="#" type="textarea" />
				</FormItem>
				<template>
					<Upload multiple type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers="myHeaders" :on-success="handleSuccess2" name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品详情图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="建议图片尺寸">宽：400px 高：400px</FormItem>
				<FormItem label="图片格式">jpg、gif、png</FormItem>
				<FormItem label="图片大小">不超过10mb 图片太大影响加载速度</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="productCannel1">取消</Button>
				<Button type="primary" size="large" @click="product1">确定</Button>
			</div>
		</Modal>
		<!-- 结算 -->
		<Modal v-model="Modal2" title="结算" width="40%">
			<Form :label-width="120" :model="jieForm" :rules="rules" ref="refuse">
				<FormItem label="每份usdt" prop="freight">
					<Input class="w-50" disabled v-model="jieForm.jiafreight" placeholder="每份usdt" />
				</FormItem>
				<FormItem label="目标份额" prop="freight">
					<Input class="w-50" disabled v-model="jieForm.fengfreight" placeholder="请输入目标份额" />
				</FormItem>
				<FormItem label="结算总额(usdt)" prop="freight">
					<Input class="w-50" v-model="jieForm.jiefreight" placeholder="请输入结算总额(usdt)" />
				</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="Modal2=false">取消</Button>
				<Button type="primary" size="large" @click="jieFormproduct">确定</Button>
			</div>
		</Modal>
		<!-- 分红 -->
		<Modal v-model="Modal3" title="分红" width="40%">
			<Form :label-width="120" :model="fenForm" :rules="rules" ref="refuse">
				<FormItem label="每份usdt" prop="freight">
					<Input class="w-50" disabled v-model="fenForm.jiafreight" placeholder="请输入每份usdt" />
				</FormItem>
				<FormItem label="目标份额" prop="freight">
					<Input class="w-50" disabled v-model="fenForm.fengfreight" placeholder="请输入目标份额" />
				</FormItem>
				<FormItem label="分红总额(usdt)" prop="freight">
					<Input class="w-50" v-model="fenForm.jiefreight" placeholder="请输入分红总额(usdt)" />
				</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="Modal3=false">取消</Button>
				<Button type="primary" size="large" @click="productFen">确定</Button>
			</div>
		</Modal>
		<!-- 进展 -->
		<Modal v-model="Modal4" title="进展" width="40%">
			<Table stripe :columns="columns4" :data="data4"></Table>
			<!-- 分页 -->
			<Page :total="info1" show-elevator show-total :page-size="pageSize1" @on-change="cuctGetQuery1" :current.sync="page1" />
		</Modal>
		<!-- 参与份额 -->
		<Modal v-model="Modal5" title="参与份额" width="40%">
			<Table stripe :columns="columns2" :data="data2"></Table>
			<Page :total="info2" show-elevator :page-size="pageSize2" show-total @on-change="cuctGetQuery2" :current.sync="page2"></Page>
		</Modal>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				info: null, // 总条数
				page: 1, // 页数
				pageSize: 10, // 每页多少条

				info1: null, // 总条数
				page1: 1, // 页数
				pageSize1: 5, // 每页多少条
				number1: "",

				info2: null, // 总条数
				page2: 1, // 页数
				pageSize2: 5, // 每页多少条

				marked: false, // 防止重复添加标记
				myHeaders: {
					Authorization: "bearer " + localStorage.getItem("mytoken")
				},
				columns1: [{
						title: "编号",
						key: "number",
						align:'center',
						width: 80
					},
					{
						title: "主图",
						key: "picture",
						align:'center',
						render: (h, params) => {
							return h("div", [
								h("img", {
									attrs: {
										src: params.row.picture,
										preview: params.row.createTime
									},
									style: {
										width: "70px",
										margin: "10px 0"
									}
								})
							]);
						}
					},
					{
						title: "详情图",
						key: "pictureDetails",
						align:'center',
						render: (h, params) => {
							let src = params.row.pictureDetails.split(";");
							return h(
								"div",
								src.map(function(item, index) {
									return h("img", {
										attrs: {
											src: item,
											preview: params.row.id
										},
										style: {
											width: "70px",
											margin: "10px 0",
											display: index == 0 ? "" : "none"
										}
									});
								})
							);
						}
					},
					{
						title: "标题(中文)",
						align:'center',
						key: "cnTitle"
					},
					{
						title: "标题(英文)",
						align:'center',
						key: "usTitle"
					},
					// {
					//   title: "标题(越南语)",
					//   key: "vnTitle"
					// },
					{
						title: "价值(usdt)",
						align:'center',
						key: "price"
					},
					{
						title: "进展",
						key: "address",
						align:'center',
						width: 80,
						align: "center",
						render: (h, params) => {
							return h("div", [
								h(
									"div", {
										props: {
											type: "primary",
											size: "small"
										},
										style: {
											marginRight: "5px",
											cursor: "pointer",
											color: "#2db7f5"
										},
										on: {
											click: () => {
												this.Modal4 = true;
												this.number1 = params.row.number;
												this.jinZhan(params);
											}
										}
									},
									"查看详情"
								)
							]);
						}
					},
					{
						title: "每份usdt",
						align:'center',
						key: "pay"
					},
					{
						title: "目标份额",
						align:'center',
						key: "total"
					},
					{
						title: "参与份额",
						align:'center',
						key: "address",
						width: 80,
						align: "center",
						render: (h, params) => {
							return h("div", [
								h(
									"div", {
										props: {
											type: "primary",
											size: "small"
										},
										style: {
											marginRight: "5px",
											cursor: "pointer",
											color: "#2db7f5"
										},
										on: {
											click: () => {
												this.Modal5 = true;
												this.number2 = params.row.id;
												// console.log(params.row);
												// console.log(obj);
												this.fenE();
											}
										}
									},
									"查看详情"
								)
							]);
						}
					},
					{
						title: "预估收益(usdt)",
						align:'center',
						key: "earnings"
					},
					// {
					//   title: "参与说明",
					//   key: "joinExplain",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.joinExplain
					//       },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//       }
					//     });
					//   }
					// },
					// {
					//   title: "收益规则说明",
					//   key: "ruleExplain",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.ruleExplain
					//       },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//       }
					//     });
					//   }
					// },
					{
						title: "状态",
						key: "status",
						align:'center',
						render: (h, params) => {
							return h(
								"div",
								params.row.status == null ?
								"#" :
								params.row.status == "1" ?
								"进行中" :
								"已结算"
							);
						}
					},
					// {
					//   title: "项目描述(中文)",
					//   key: "cnDetails",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.cnDetails
					//       },
					//       class: {
					//         //  由于class 在JS 中是关键字，所以用了引号，但是实际上不加也不会报错
					//         // details:true
					//       },
					//       // domProps: {
					//       //   innerText: params.row.cnDetails
					//       // },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//         // display: "block",
					//         // maxHeight: "70px",
					//         // maxWidth: "70px"
					//         // webkitLineClamp: "2",
					//         // display: "-webkit-box",
					//         // webkitBoxOrient: "vertical",
					//         // overflow: "hidden",
					//         // textOverflow: "ellipsis"
					//       }
					//     });
					//     // return h("div", [
					//     //   h("img", {
					//     //     attrs: {
					//     //       src: params.row.cnDetails,
					//     //       // preview: params.row.createTime
					//     //     },
					//     //     style: {
					//     //       width: "70px",
					//     //       margin: "10px 0"
					//     //     }
					//     //   })
					//     // ]);
					//   }
					// },
					// {
					//   title: "项目描述(英文)",
					//   key: "usDetails",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.usDetails
					//       },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//       }
					//     });
					//   }
					// },
					// {
					//   title: "项目描述(越南语)",
					//   key: "vnDetails",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.vnDetails
					//       },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//       }
					//     });
					//   }
					// },
					{
						title: "参与开始时间",
						key: "joinTime ",
						align:'center',
						render: (h, params) => {
							return h(
								"div",
								params.row.joinTime == null ?
								"#" :
								this.stringToTime(params.row.joinTime)
							);
						}
					},
					{
						title: "发布添加时间",
						key: "createTime ",
						align:'center',
						render: (h, params) => {
							return h(
								"div",
								params.row.createTime == null ?
								"#" :
								this.stringToTime(params.row.createTime)
							);
						}
					},
					{
						title: "操作",
						key: "action",
						width: 200,
						align: "center",
						render: (h, params) => {
							return h("div", [
								h(
									"Button", {
										props: {
											type: "primary",
											size: "small"
										},
										style: {
											marginRight: "5px"
										},
										on: {
											click: () => {
												this.Modal1 = true;

												this.edit(params.row);
												// this.axios
												//   .post("crowdfunding/project/query",this.qs.stringify({
												//     uuid:params.row.uuid
												//   }))
												//   .then(res => {
												//     this.data1 = res.data.data.records;
												//     console.log(res.data.data.records);
												//   });
											}
										}
									},
									"修改"
								),
								h(
									"Button", {
										props: {
											type: "error",
											size: "small",
											disabled: params.row.status == 1 ?
												false :
												params.row.status == 2 ?
												true :
												false
										},
										style: {
											marginRight: "5px"
										},
										on: {
											click: () => {
												this.Modal2 = true;
												this.jieForm.jiefreight = "";
												this.jieGet(params);
											}
										}
									},
									"结算"
								),
								h(
									"Button", {
										props: {
											type: "error",
											size: "small",
											disabled: params.row.status == 1 ?
												false :
												params.row.status == 2 ?
												true :
												false
										},
										style: {
											marginRight: "5px"
										},
										on: {
											click: () => {
												this.Modal3 = true;
												this.fenForm.jiefreight = "";
												this.fenGet(params);
											}
										}
									},
									"分红"
								)
							]);
						}
					}
				],
				data1: [],
				columns4: [{
						title: "项目编号",
						align:'center',
						key: "number"
					},
					{
						title: "描述(中文)",
						key: "cnContent ",
						align:'center',
						render: (h, params) => {
							return h("div", {
								domProps: {
									innerHTML: params.row.cnContent
								},
								style: {
									textOverflow: "ellipsis",
									whiteSpace: "nowrap",
									overflow: "hidden"
								}
							});
						}
					},
					{
						title: "描述(英文)",
						key: "usContent ",
						align:'center',
						render: (h, params) => {
							return h("div", {
								domProps: {
									innerHTML: params.row.usContent
								},
								style: {
									textOverflow: "ellipsis",
									whiteSpace: "nowrap",
									overflow: "hidden"
								}
							});
						}
					},
					// {
					//   title: "描述(越南文)",
					//   key: "vnContent ",
					//   render: (h, params) => {
					//     return h("div", {
					//       domProps: {
					//         innerHTML: params.row.vnContent
					//       },
					//       style: {
					//         textOverflow: "ellipsis",
					//         whiteSpace: "nowrap",
					//         overflow: "hidden"
					//       }
					//     });
					//   }
					// },
					{
						title: "时间",
						key: "createTime ",
						align:'center',
						render: (h, params) => {
							return h(
								"div",
								params.row.createTime == "null" ?
								"#" :
								this.stringToTime(params.row.createTime)
							);
						}
					}
				],
				data4: [],
				query: {
					number: "",
					status: "0",
					startTime: ""
				},
				Modal: false,
				addForm: {
					picture: "", //主图
					pictureDetails: "", //详情图
					cnTitle: "", //中文标题
					usTitle: "", //英文标题
					// vnTitle: "", //越南文标题
					price: "", //价值
					cnDetails: "", //中文详情
					usDetails: "", //英文详情
					// vnDetails: "", //越南文详情
					pay: "", //每份usdt
					total: "", //目标份额
					earnings: "", //预估收益
					status: "", //状态
					time: "", //参与开始时间
					joinExplain: "", // 参与说明
					ruleExplain: "" //收益规则说明
				},
				jieForm: {
					jiafreight: "",
					fengfreight: "",
					jiefreight: "",
					id: ""
				},
				fenForm: {
					jiafreight: "",
					fengfreight: "",
					jiefreight: "",
					id: ""
				},
				Modal1: false,
				Modal2: false,
				Modal3: false,
				Modal4: false,
				Modal5: false,
				columns2: [{
						title: "个人ID",
						align:'center',
						key: "uuid"
					},
					{
						title: "账号",
						align:'center',
						key: "userName"
					},
					{
						title: "参与份额",
						align:'center',
						key: "total"
					},
//					{
//						title: "Estate单价",
//						align:'center',
//						key: "exuuPrice"
//					},
					{
						title: "当前总支付",
						align:'center',
						key: "payExuu",
						render: (h, params) => {
							return h(
								"div",
								params.row.payType == "null" ?
								"#" :
								params.row.payType == 1 ?
								params.row.payExuu + " USDT" :
								params.row.payExuu + " Estate"
							);
						}
					},
					{
						title: "参与时间",
						align:'center',
						key: "createTime",
						render: (h, params) => {
							return h(
								"div",
								params.row.createTime == "null" ?
								"#" :
								this.stringToTime(params.row.createTime)
							);
						}
					}
				],
				data2: [],
				dataValue: ["", ""], //时间段
				updateForm: {
					picture: "", //主图
					pictureDetails: "", //详情图
					cnTitle: "", //中文标题
					usTitle: "", //英文标题
					// vnTitle: "", //越南文标题
					price: "", //价值
					cnDetails: "", //中文详情
					usDetails: "", //英文详情
					// vnDetails: "", //越南文详情
					pay: "", //每份usdt
					total: "", //目标份额
					earnings: "", //预估收益
					status: "", //状态
					joinTime: "", //参与开始时间
					joinExplain: "", // 参与说明
					ruleExplain: "" //收益规则说明
				}, // 修改
				rules: {}, //验证
				imgUrl: "",
				editorOption: this.quillOption,
				joinTimeDate: "",
				joinTime: ""
			};
		},
		methods: {
			getMangement(page) {
				// 页面初始化函数
				let params = this.qs.stringify({
					current: page,
					size: this.pageSize,
					number: this.query.number,
					status: this.query.status,

					startTime: this.dataValue[0] == "" ? "" : this.dataValue[0] + " 00:00:01", // 起始日期,
					endTime: this.dataValue[1] == "" ? "" : this.dataValue[1] + " 23:59:59" // 结束日期,
					// startTime: this.dataValue[0] == "" ? "" : this.dataValue[0] + "00:00:01"
				});

				this.axios.post("crowdfunding/project/query", params).then(res => {
					this.data1 = res.data.data.records;
					this.info = res.data.data.total;
					// console.log(res.data.data);

					// console.log(res.data.data.records);
				});
			},
			//查询
			getConditionQuery() {
				this.page = 1
				this.getMangement(this.page);
			},
			postAddMangement() {
				if(this.addForm.cnTitle == "") {
					this.$Message.info("项目标题中文不能为空");
					return;
				}
				if(this.addForm.usTitle == "") {
					this.$Message.info("项目标题英文不能为空");
					return;
				}
				// if (this.addForm.vnTitle == "") {
				//   this.$Message.info("项目标题越南语不能为空");
				//   return;
				// }

				if(this.addForm.cnDetails == "") {
					this.$Message.info("项目描述中文不能为空");
					return;
				}
				if(this.addForm.usDetails == "") {
					this.$Message.info("项目描述英文不能为空");
					return;
				}
				// if (this.addForm.vnDetails == "") {
				//   this.$Message.info("项目描述越南文不能为空");
				//   return;
				// }
				if(this.addForm.price == "") {
					this.$Message.info("项目价值不能为空");
					return;
				}
				if(this.addForm.pay == "") {
					this.$Message.info("每份usdt不能为空");
					return;
				}
				if(this.addForm.total == "") {
					this.$Message.info("目标份额不能为空");
					return;
				}
				if(this.addForm.earnings == "") {
					this.$Message.info("预估收益不能为空");
					return;
				}
				if(this.addForm.time == "") {
					this.$Message.info("参与开始时间不能为空");
					return;
				}
				if(this.addForm.time <= new Date()) {
					this.$Message.info("参与开始时间必须大于当前时间");
					return;
				}
				if(this.addForm.picture == "") {
					this.$Message.info("主图不能为空");
					return;
				}
				if(this.addForm.pictureDetails == "") {
					this.$Message.info("详情图不能为空");
					return;
				}
				//
				if(isNaN(this.addForm.price)) {
					this.$Message.info("项目价值请输入数字");
					return;
				}
				if(isNaN(this.addForm.pay)) {
					this.$Message.info("每份usdt请输入数字");
					return;
				}
				if(isNaN(this.addForm.total)) {
					this.$Message.info("目标份额请输入数字");
					return;
				}
				if(isNaN(this.addForm.earnings)) {
					this.$Message.info("预估收益请输入数字");
					return;
				}
				// 发布函数
				let params = this.qs.stringify({
					picture: this.addForm.picture,
					pictureDetails: this.addForm.pictureDetails,
					cnTitle: this.addForm.cnTitle,
					usTitle: this.addForm.usTitle,
					// vnTitle: this.addForm.vnTitle,
					price: this.addForm.price,
					cnDetails: this.addForm.cnDetails,
					usDetails: this.addForm.usDetails,
					// vnDetails: this.addForm.vnDetails,
					pay: this.addForm.pay,
					total: this.addForm.total,
					earnings: this.addForm.earnings,
					status: this.addForm.status,
					joinExplain: this.addForm.joinExplain,
					ruleExplain: this.addForm.ruleExplain,
					time: this.stringToTime(this.addForm.time)
				});
				if(!this.marked) {
					this.marked = true;
					this.axios.post("crowdfunding/project/add", params).then(res => {
						// console.log(res);

						if(res.data.code == 200) {
							this.$Message.info(res.data.msg);
							this.Modal = false;
							this.page = 1
							this.getMangement(this.page);
						}
						setTimeout(() => {
							this.marked = false;
						}, 1000);
					});
				}
			},
			handleSuccess(res, file) {
				this.$Message.info(res.msg);
				this.imgUrl = res.data[0].url;
				this.imgUrl2 = res.data[0].url;
				this.addForm.picture = this.imgUrl; // 添加产品主图
				this.updateForm.picture = this.imgUrl2; // 修改产品主图
			},
			handleSuccess2(res, file) {
				this.$Message.info(res.msg);
				this.addForm.pictureDetails == "" ?
					"" :
					(this.addForm.pictureDetails += ";");
				this.updateForm.pictureDetails == "" ?
					"" :
					(this.updateForm.pictureDetails += ";");
				this.addForm.pictureDetails += res.data[0].url; // 添加产品主图
				this.updateForm.pictureDetails += res.data[0].url; // 修改产品主图
			},
			add() {
				this.Modal = true;
				this.imgUrl = null;
				this.query = {
					number: "",
					status: "0",
					startTime: ""
				},
				this.addForm = {
					picture: "", //主图
					pictureDetails: "", //详情图
					cnTitle: "", //中文标题
					usTitle: "", //英文标题
					// vnTitle: "", //越南文标题
					price: "", //价值
					cnDetails: "", //中文详情
					usDetails: "", //英文详情
					// vnDetails: "", //越南文详情
					pay: "", //每份usdt
					total: "", //目标份额
					earnings: "", //预估收益
					status: "", //状态
					time: "", //参与开始时间
					joinExplain: "", // 参与说明
					ruleExplain: "" //收益规则说明
				};
				this.marked = false;
				this.$refs.upload1.clearFiles();
				this.$refs.upload2.clearFiles();
			},
			edit(params) {
				// 复制选择修改的页面的数据
				this.updateForm.picture = params.picture; //主图
				this.updateForm.pictureDetails = params.pictureDetails; //详情图
				this.updateForm.cnTitle = params.cnTitle; //中文标题
				this.updateForm.usTitle = params.usTitle; //英文标题
				// this.updateForm.vnTitle = params.vnTitle; //越南文标题
				this.updateForm.price = params.price; //价值
				this.updateForm.cnDetails = params.cnDetails; //中文详情
				this.updateForm.usDetails = params.usDetails; //英文详情
				// this.updateForm.vnDetails = params.vnDetails; //越南文详情
				this.updateForm.pay = params.pay; //每份usdt
				this.updateForm.total = params.total; //目标份额
				this.updateForm.earnings = params.earnings; //预估收益
				this.updateForm.status = params.status; //状态
				// this.updateForm.joinTime=params.joinTime;//参与开始时间
				this.updateForm.joinTime = this.stringToTime(params.joinTime);
				this.updateForm.id = params.id;
				this.updateForm.joinExplain = params.joinExplain;
				this.updateForm.ruleExplain = params.ruleExplain;
			},

			//结算
			jieGet(params) {
				this.jieForm.id = params.row.id;
				this.jieForm.jiafreight = params.row.pay;
				this.jieForm.fengfreight = params.row.total;
			},
			jieFormproduct(params) {
				if(isNaN(this.jieForm.jiefreight)) {
					this.$Message.info("结算总额请输入数字");
					return false;
				}
				let str = this.qs.stringify({
					usdt: this.jieForm.jiefreight,
					projectId: this.jieForm.id
				});
				this.axios.post("crowdfunding/project/billing", str).then(res => {
					if(res.data.code == 200) {
						this.$Message.info(res.data.msg);
						this.Modal2 = false;
						this.getMangement(this.page);
					}
				});
			},
			//分红
			fenGet(params) {
				this.fenForm.id = params.row.id;
				this.fenForm.jiafreight = params.row.pay;
				this.fenForm.fengfreight = params.row.total;
			},
			productFen() {
				if(isNaN(this.fenForm.jiefreight)) {
					this.$Message.info("分红总额请输入数字");
					return false;
				}
				let str = this.qs.stringify({
					usdt: this.fenForm.jiefreight,
					projectId: this.fenForm.id
				});
				this.axios.post("crowdfunding/project/share", str).then(res => {
					if(res.data.code == 200) {
						this.$Message.info(res.data.msg);
						this.Modal3 = false;
					}
				});
			},

			jinZhan(params) {
				let params1 = params;
				// console.log(params1);
				let obj = this.qs.stringify({
					number: this.number1,
					current: this.page1,
					size: this.pageSize1
				});
				this.axios.post("crowdfunding/project/get/progress", obj).then(res => {
					// console.log(res);
					// console.log(res.data.data.records);
					this.data4 = res.data.data.records;
					this.info1 = res.data.data.total;
				});
			},
			fenE() {
				let obj = this.qs.stringify({
					projectId: this.number2,
					current: this.page2,
					size: this.pageSize2
				});
				this.axios.post("crowdfunding/project/get/participate", obj).then(res => {
					console.log(res);
					this.data2 = res.data.data.records;
					this.info2 = res.data.data.total;
				});
			},
			getTime(daterange) {
				// 处理时间段时间格式
				this.dataValue = daterange;
			}, //时间
			joinTime1(time) {
				this.time = time;
			}, // 时间函数
			// joinTime(time) { // 活动开始时间
			// 		this.joinTimeDate = time;
			// 	},
			onEditorFocus() {},
			onEditorBlur() {},
			onEditorChange() {},
			// handleSuccess(){

			// },//图片上传成功的函数
			// handleSuccess2(){

			// },
			productCannel() {
				this.Modal = false;
			}, //发布取消的函数
			product() {
				this.Modal = false;
			}, //发布确定的函数
			productCannel1() {
				this.Modal1 = false;
			}, //修改取消的函数
			product1() {
				if(this.updateForm.cnTitle == "") {
					this.$Message.info("项目标题中文不能为空");
					return;
				}
				if(this.updateForm.usTitle == "") {
					this.$Message.info("项目标题英文不能为空");
					return;
				}
				// if (this.updateForm.vnTitle == "") {
				//   this.$Message.info("项目标题越南语不能为空");
				//   return;
				// }

				if(this.updateForm.cnDetails == "") {
					this.$Message.info("项目描述中文不能为空");
					return;
				}
				if(this.updateForm.usDetails == "") {
					this.$Message.info("项目描述英文不能为空");
					return;
				}
				// if (this.updateForm.vnDetails == "") {
				//   this.$Message.info("项目描述越南文不能为空");
				//   return;
				// }
				if(this.updateForm.price == "") {
					this.$Message.info("项目价值不能为空");
					return;
				}
				if(this.updateForm.pay == "") {
					this.$Message.info("每份usdt不能为空");
					return;
				}
				if(this.updateForm.total == "") {
					this.$Message.info("目标份额不能为空");
					return;
				}
				if(this.updateForm.earnings == "") {
					this.$Message.info("预估收益不能为空");
					return;
				}
				if(this.updateForm.joinTime == "") {
					this.$Message.info("参与开始时间不能为空");
					return;
				}
				if(this.updateForm.picture == "") {
					this.$Message.info("主图不能为空");
					return;
				}
				if(this.updateForm.pictureDetails == "") {
					this.$Message.info("详情图不能为空");
					return;
				}
				//

				if(isNaN(this.updateForm.price)) {
					this.$Message.info("项目价值请输入数字");
					return;
				}
				if(isNaN(this.updateForm.pay)) {
					this.$Message.info("每份usdt请输入数字");
					return;
				}
				if(isNaN(this.updateForm.total)) {
					this.$Message.info("目标份额请输入数字");
					return;
				}
				if(isNaN(this.updateForm.earnings)) {
					this.$Message.info("预估收益请输入数字");
					return;
				}

				let params = this.qs.stringify({
					picture: this.updateForm.picture,
					picture: this.updateForm.picture,
					pictureDetails: this.updateForm.pictureDetails,
					cnTitle: this.updateForm.cnTitle,
					usTitle: this.updateForm.usTitle,
					// vnTitle: this.updateForm.vnTitle,
					price: this.updateForm.price,
					cnDetails: this.updateForm.cnDetails,
					usDetails: this.updateForm.usDetails,
					// vnDetails: this.updateForm.vnDetails,
					pay: this.updateForm.pay,
					total: this.updateForm.total,
					earnings: this.updateForm.earnings,
					status: this.updateForm.status,
					time: this.stringToTime(this.updateForm.joinTime),
					id: this.updateForm.id,
					joinExplain: this.updateForm.joinExplain,
					ruleExplain: this.updateForm.ruleExplain
				});
				this.axios.post("crowdfunding/project/update", params).then(res => {
					if(res.data.code == 200) {
						this.$Message.info(res.data.msg);
						this.Modal1 = false;
						this.getMangement(this.page);
					}
				});
			}, //修改确定的函数
			cuctGetQuery() {
				this.getMangement(this.page);
			}, // 页码改变的回调
			cuctGetQuery1() {
				this.jinZhan();
			}, // 页码改变的回调
			cuctGetQuery2() {
				this.fenE();
			}, // 页码改变的回调
			//页面加载
			getprogress() {
				// let obj = this.qs.stringify({
				//   current: this.page,
				//   size: this.pageSize,
				//   number: this.query.number,
				//   status: this.query.status,
				//   startTime:
				//     this.dataValue[0] == "" ? "" : this.dataValue[0] + " 00:00:01", // 起始日期,
				//   endTime: this.dataValue[1] == "" ? "" : this.dataValue[1] + " 23:59:59" // 结束日期,
				// });
				// console.log(this.dataValue);
				//  console.log(obj);
				this.axios.post("crowdfunding/progress/query").then(res => {
					// console.log(res);
					this.data4 = res.data.data.records;
					this.info = res.data.data.total;
				});
			}
		},
		mounted() {
			this.getMangement(1);
			// this.getprogress();
		}
	};
</script>

<style scoped>
	.sp {
		display: inline-block;
		padding-right: 20px;
	}
	
	.time {
		font-size: 14px;
		font-weight: bold;
	}
	
	.content {
		padding-left: 5px;
	}
	
	.quill {
		height: 200px;
	}
	
	.details img {
		display: block;
		width: 70px;
		height: 70px;
	}
</style>